﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Practices.Unity;
using Vit.Common.Extensions;
using Vit.Common.Providers;

namespace Vit.Common.Helpers
{
    public class Logger
    {
        public static void Log(LogInfo logInfo)
        {
            Unity.Current.ResolveAny<ILogProvider>().ForEach(p => p.Log(logInfo));
        }

        public static void Log(Exception exception)
        {
            Unity.Current.ResolveAny<ILogProvider>().ForEach(p => p.Log(exception));
        }

        public static void Log(string source, string message)
        {
            Unity.Current.ResolveAny<ILogProvider>().ForEach(p => p.Log(source, message));
        }

        public static void Log(Exception exception, LogLevel logLevel)
        {
            Unity.Current.ResolveAny<ILogProvider>().ForEach(p => p.Log(exception, logLevel));
        }

        public static void Log(string source, string message, LogLevel logLevel)
        {
            Unity.Current.ResolveAny<ILogProvider>().ForEach(p => p.Log(source, message, logLevel));
        }
    }
}
